import hAudit from './hAudit.vue'

export const showAuditModal = (options) => {
    return new Promise((resolve) => {
        const uploadInstance: any = createApp(hAudit, {
            status:options.status,
        })
        const mountNode = document.createElement('div')
        document.getElementById('app').append(mountNode)
        uploadInstance.mount(mountNode)
        if (uploadInstance) {
            uploadInstance._instance?.proxy?.showModal()
            // vue3的$on方法已移除
            uploadInstance._instance?.proxy?.Mit.on('submit', (res) => {
                resolve(res)
                uploadInstance.unmount(mountNode)
                document.getElementById('app').removeChild(mountNode)
            })
        }
    })
}
